package com.socodethis.spaceex;

import com.badlogic.gdx.Gdx;
import com.socodethis.spaceex.math.cPoint;

public class dungeonConnect{
	//dungeon1 is entrance dungeon2 is exit
	simpleNode dungeon1, dungeon2;
	public dungeonConnect(simpleNode dungeon1,simpleNode dungeon2){
		this.dungeon1 = new simpleNode(dungeon1);
		this.dungeon2 = new simpleNode(dungeon2);
	}
	public boolean getEquals(simpleNode node){
		if (node.isEqual(dungeon1) || node.isEqual(dungeon2)){
			return true;
		}
		return false;
	}
	//This assumes that getEquals has been called
	public simpleNode getConnect(simpleNode node){
		if (node.isEqual(dungeon1)){
			return dungeon2;
		}
		return dungeon1;
	}
	public int getConnect(int dungeon){
		if (this.dungeon1.getDungeon() == dungeon){
			return dungeon2.getDungeon();
		}
		return dungeon1.getDungeon();
	}
	public boolean hasDungeon(int dungeon){
		if (this.dungeon1.getDungeon() == dungeon  || this.dungeon2.getDungeon() == dungeon ){
			return true;
		}
		return false;
	}
	public void printConnection(){
		Gdx.app.log("dungeonConnect","---------------");
		dungeon1.printNode();
		Gdx.app.log("dungeonConnect","Connects to...");
		dungeon2.printNode();
		Gdx.app.log("dungeonConnect","---------------");
	}
	
}
